<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<title> Album </title>
	<meta charset="UTF-8">
	<style type="text/css">
            
		#gallery, #upload {
			border: 1px solid #ccc; margin: 10px auto; width: 570px; padding: 10px;
		}
		#blank_gallery {
			font-family: Arial; font-size: 18px; font-weight: bold;
			text-align: center;
		}
                #select{
                     float:left;border: 1px solid #ccc; margin: 10px auto; width: 140px; padding: 10px; 
                    
                }
		.thumb {
			float: left; width: 150px; height: 100px; padding: 10px; margin: 10px; background-color: #ddd;
		}
		.thumb:hover {
			outline: 1px solid #999;
		}
		img {
			border: 0;
		}
		#gallery:after {
			content: "."; visibility: hidden; display: block; clear: both; height: 0; font-size: 0;
		}
	</style>
</head>
<body>
    
     
   
    <div id="gallery">
		<?php if (isset($images) && count($images)):
			foreach($images as $image):	?>
			<div class="thumb">
				<a href="<?php echo $image['url'];?>" title="<?php echo $image['image_title'] ?>">
					<img src="<?php echo $image['thumb_url']; ?>" />
				</a>
			</div>
                        <div>
                           <form name ="delete" method="post" action="album/delete_gambar" >
                                <input type="submit" value ="delete" />
                                <input type="hidden" name="img_id" value="<?php echo $image['album_id']?>" />
                            </form> 
                        </div>
                        
		<?php endforeach; else: ?>
			<div id="blank_gallery">Please Upload an Image</div>
		<?php endif; ?>
                
	</div>
	
    //open the form
    <?php echo form_open_multipart('album');?>  
    
       <div id="select">
           <p>masukan nama gambar</p>
           <?php echo form_input('title');?>  
           
      </div>
    
       <div>
           <p> Kategori </p>
           <?php $options = array('keluarga'=>'keluarga', 'kerja' => 'kerja', 'travel' => 'travel', 'profil' => 'profil')?>
           <?php  echo form_dropdown('category',$options);?>
       </div>
    
	<div id="upload">
		<?php
		
		echo form_upload('userfile');
		echo form_submit('upload', 'Upload');
		
		?>		
	</div>
    <?php echo form_close(); ?>
</body>
</html>